﻿using System;
using System.Collections.Generic;

using System.Text;
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using Core = Microsoft.Office.Core;
namespace ServerApp
{
   public class ControlPowerPoint
    {

        private PowerPoint.Application PPA;
        private PowerPoint.Presentation PPE;
        //String Path = "C:/Users/KimNhu/AppData/LocalLow/DATA/b.ppt";
        String Path = "D:/";
        public void OpenPowerPoint(string filename)
        {
            Path += filename;
            PPA = new PowerPoint.Application();
            PPA.WindowState = PowerPoint.PpWindowState.ppWindowNormal;
            //PPE = PPA.Presentations.Open(Path, Core.MsoTriState.msoFalse, Core.MsoTriState.msoFalse, Core.MsoTriState.msoTrue);
            PPE = PPA.Presentations.Open(Path, Core.MsoTriState.msoFalse, Core.MsoTriState.msoFalse, Core.MsoTriState.msoTrue);
            PPE.SlideShowSettings.Run();
        }
        public void Next()
        {
            PowerPoint.SlideShowView next = PPE.SlideShowWindow.View;
            next.Next();
        }
        public void Previous()
        {
            PowerPoint.SlideShowView previous = PPE.SlideShowWindow.View;
            previous.Previous();
        }
        public void Home()
        {
           // PowerPoint.SlideShowView previous = PPE.SlideShowWindow.View;
            //previous.First();

        }
        public void End()
        {
            PowerPoint.SlideShowView previous = PPE.SlideShowWindow.View;
            previous.Last();
        }
        public void Close()
        {
            PPA.Quit();
            PPE.Close();
        }
    }
}
